<?php
require_once dirname(__FILE__) . '/../../../incls/php/dbutils.class.php';
require_once dirname(__FILE__) . '/../../../incls/php/miscutils.class.php';
require_once dirname(__FILE__) . '/../../../incls/php/config.php';

$myPdo = DbUtils::createPdoInst();

$SIZE = 10;
$cond_vals = NULL;
$page = MiscUtils::getParam('p', 1);
$order = MiscUtils::getParam('o', 't.date');
$queue = MiscUtils::getParam('q', 'DESC');
$opts = new stdClass();
$opts->select_expr = 'Distinct t.id, t.title';
$updateds = DbUtils::get($myPdo,  TABLE_NAME_PREFIX_PLUGIN . 'art_post', $cond_vals, $order, $queue, $page, $SIZE, $opts)->d;
?>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="../../../libs/jquery/jquery-1.6.2.min.js"></script>
<style>
.title {
  display: table-cell;
  width: 189px;
  height: 29px;
  padding-left: 5px;
  vertical-align: middle;
  background: url(images/titlebg.gif);
  font: bold 14px Arial;
  color: #fff;
}
#scroller {
  margin: 0px;
  list-style: none;
  padding: 8px;
}

#scroller li {
  width: 100%;
  vertical-align: middle;
  background: url(images/bullet.gif) no-repeat left center;
  clear: both;
  font: 12px/1.5 Verdana, Arial, Helvetica, sans-serif, "宋体";
  line-height: 18px;
  padding: 2px 0 2px 8px;
  height: 18px;
}

#scroller a {
  color: #333;
  text-decoration: none;
}
#scroller a:hover{
  text-decoration: underline;
}
</style>
</head>

<body>

<div style="border: 1px solid #ddd;">
  <div class="title">Latest Articles</div>
  <ul id="scroller">
    <?php foreach ($updateds as $idx => &$item) { ?>
    <li><a href="#" title="<?php echo $item->title; ?>" onclick="parent.location.href='<?php echo 'http://' . URL . '?i=' . NEWS_ID . "&script=index_detail&news=$item->id"; ?>';"><?php echo MiscUtils::getShortName($item->title, 12); ?><a></li>
    <?php } ?>
    <?php if (count($updateds) == 0) { ?>
    <li>No Result Found</li>
    <?php } ?>
  </ul>
</div>
</body>
</html>
